package exam.test17;

import java.util.Scanner;
import java.util.TreeMap;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Endstart
 * Date: 2020-12-17
 * Time: 9:19
 */
public class GamePlay {

    /**
     * game player main method
     * @param args
     */
    public static void main(String[] args) {

        TreeMap<String, Integer> map = new TreeMap<>();
        Object one = null;
        Object two = null;
        Scanner scanner = new Scanner(System.in);
        while (true) {
            System.out.print("player common.stack.delayStack.one input:");
            one = PlayUtil.genObject(scanner.nextLine());
            if (one != null) {
                break;
            } else {
                System.out.println("Input error, please input again.");
            }
        }

        while (true) {
            System.out.print("player common.stack.delayStack.two input:");
            two = PlayUtil.genObject(scanner.nextLine());
            if (two != null) {
                break;
            } else {
                System.out.println("Input error, please input again.");
            }
        }

        int ret = PlayUtil.check(one, two);
        if (ret == 0) {
            System.out.println("draw");
        } else if (ret == 1) {
            System.out.println("player common.stack.delayStack.one win");
        } else {
            System.out.println("player common.stack.delayStack.two win");
        }

    }
}
